﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Client
{
   public static class ExMothed
    {
       public static string To有无(this bool value)
       {
           return value ? "有" : "无";
       }

       public static string To是否(this bool value)
       {
           return value ? "是" : "否";
       }

       public static string To有无(this bool? value)
       {
           if (value == null)
               return "无";
           else
           {
               return value.Value ? "有" : "无";
           }
       }

       public static string To是否(this bool? value)
       {
           if (value == null)
               return "是";
           else
           {
               return value.Value ? "是" : "否";
           }
       }

       public static string ToShortTime(this DateTime? value)
       {
           if (value == null)
               return "未设置";
           return value.Value.ToString("HH:mm:ss");
       }
    }
}
